package com.zc.cloud.register.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.netflix.eureka.server.event.EurekaInstanceRegisteredEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;

/**
 * 服务注册监听
 * @projectName:
 * @package:        com.rayeye.cloud.register.listener
 * @ClassName:      InstanceRegisterListener
 * @description:    服务注册监听
 * @author:         Neil.Zhou
 * @createDate:     2018-11-19 16:58
 * @UpdateUser:     Neil.Zhou
 * @updateDate:     2018-11-19 16:58
 * @updateRemark:   The modified content
 * @version:        1.0
 * <p>Copyright: Copyright (c) 2018-11-19</p>
 *
 */
@Configuration
public class InstanceRegisterListener implements ApplicationListener<EurekaInstanceRegisteredEvent> {
    private static Logger logger = LoggerFactory.getLogger(InstanceCancelListener.class);

    public void onApplicationEvent(EurekaInstanceRegisteredEvent eurekaInstanceRegisteredEvent) {
        logger.info("服务：{}注册成功....",eurekaInstanceRegisteredEvent.getInstanceInfo().getAppName());
    }
}
